import itertools

letters = ['a', 'b']
numbers = [1, 2, 3]

cartesian_product = itertools.product(letters, numbers)

for element in cartesian_product:
    print(element)